﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Wedn.Net.Model;
using Wedn.Net.IBLL;

namespace Wedn.Net.UnitTest.InitData
{
    [TestClass]
    public class InitPost
    {
        [TestMethod]
        public void TestMethod1()
        {
            IPostManager postBll = BLLFactory.BLLFactory.Instance.PostManager;
            for (int i = 100; i < 500; i++)
            {
                Post entity = new Post();
                entity.UserId = 1;
                entity.Slug = "hello-world-" + i;
                entity.Title = "世界，你好-" + i;
                entity.PubDate = DateTime.Today.AddMinutes(i - 99);
                entity.Modified = entity.PubDate;
                entity.Content = "欢迎使用 Wedn.Net。这是系统自动生成的演示文章。编辑或者删除它，然后开始您的博客！";
                entity.Excerpt = "欢迎使用 Wedn.Net！";
                entity.Type = 0;
                entity.IsTop = false;
                entity.Status = 0;
                entity.CommentStatus = 0;
                entity.PingStatus = 0;
                entity.Pinged = string.Empty;
                entity.Password = string.Empty;
                entity.CommentCount = 0;
                entity.ViewCount = 0;
                entity.ParentId = 0;
                postBll.Insert(entity);
            }
            int rows = BLLFactory.BLLFactory.Instance.DbSaveChanges();
        }
    }
}
